package cn.xsw.utils;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.beans.factory.annotation.Value;

/**
 * 基础分页查询类
 * 提供pageNo,pageSize
 * @author LiangYihui
 * @param <T>
 */
@Data
public class BaseQuery<T>{

    @ApiModelProperty(value = "页码",example = "1")
    private Integer pageNo;

    @ApiModelProperty(value = "页大小",example = "5")
    private Integer pageSize;

    public BaseQuery() {
        this.pageNo = 1;
        this.pageSize = 5;
    }

    // 分页
    public Page page() {
        Page<T> iPage = new Page<>(pageNo,pageSize);
        return iPage;
    }

}
